home *** CD-ROM | disk | FTP | other *** search
- /*
- panels.c
-
- This file contains the routines for handling panels.
-
- Created 9/2/92 - Dave Hersey
-
- ----------------------------------------------
-
- 2/1/93 debugged and plopped on GX CD. - dmh
- 9/93 updated to run with the ß2 "GXified" interface files - PLA
- 3/94 updated for B4 - dmh
- 8/94 universalized - dmh
- */
-
- #include <stdio.h>
- #include <FontLibrary.h>
- #include <GraphicsLibraries.h>
- #include <GXEnvironment.h>
- #include <GXErrors.h>
- #include <QDLibrary.h>
- #include <GXPrinting.h>
- #include <Collections.h>
-
- #include "Banana Jr.h"
-
-
- OSErr PageFormatDialog(gxFormat aFormat, StringPtr title, gxDialogResult *result)
- {
- OSErr err;
-
- err = SetUpByPagePanel(aFormat, gAppResRefNum);
-
- if (!err)
- err = Forward_GXFormatDialog(aFormat, title, result);
-
- return err;
- }
-
-
- OSErr SetUpByPagePanel(gxFormat aFormat, short ourResFile)
- {
- OSErr err;
- Collection fmtCollection;
- gxPanelSetupRecord panelInfo;
- T_BananaCollection bananaConfig;
-
- fmtCollection = GXGetFormatCollection(aFormat);
-
- err = GetCollectionItem(fmtCollection, kBananaCollectionType,
- gxPrintingTagID, nil, &bananaConfig);
-
- if (err == collectionItemNotFoundErr)
- {
- bananaConfig.one = 0;
- bananaConfig.two = false;
- bananaConfig.three = false;
- bananaConfig.four = false;
-
- err = AddCollectionItem(fmtCollection, kBananaCollectionType,
- gxPrintingTagID, sizeof(T_BananaCollection),
- &bananaConfig);
- }
-
- if (!err)
- {
- panelInfo.panelKind = gxApplicationPanel;
- panelInfo.panelResId = kFormatPanelResID;
- panelInfo.resourceRefNum = ourResFile;
- panelInfo.refCon = 0;
-
- err = GXSetupDialogPanel(&panelInfo);
- }
-
- return err;
- }
-
-